package com.common.utils.CommonException;

import lombok.Data;

@Data
public class CommonRuntimeException extends RuntimeException {

    private Integer code;

    private String message;

    public CommonRuntimeException(Integer code,String message){
        this.code = code;
        this.message = message;
    }

    public CommonRuntimeException(){
        this.code = ExceptionCodeEnum.SERVER_ERROR.getCode();
        this.message = ExceptionCodeEnum.SERVER_ERROR.getMessage();
    }

    public CommonRuntimeException(ExceptionCodeEnum exceptionCodeEnum){
        this.code = exceptionCodeEnum.getCode();
        this.message = exceptionCodeEnum.getMessage();
    }
}
